﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Star.Tools.Excel.Model;

namespace Star.Tools.Excel
{
    public static class NpoiExtensions
    {
        public const int RowMaxXls = 65536, RowMaxXlsx = 1048576, ColumnMaxXls = 256, ColumnMaxXlsx = 16384;

        public static int GetRowMax(ExcelFormat version)
        {
            switch (version)
            {
                case ExcelFormat.xls: return RowMaxXls;
                case ExcelFormat.xlsx: return RowMaxXlsx;
            }
            throw new InvalidEnumArgumentException("version", (int)version, version.GetType());

        }
        public static int GetColumnMax(ExcelFormat version)
        {
            switch (version)
            {
                case ExcelFormat.xls: return ColumnMaxXls;
                case ExcelFormat.xlsx: return ColumnMaxXlsx;
            }
            throw new InvalidEnumArgumentException("version", (int)version, version.GetType());
        }

        
    }
}
